<?php
/**
 * The following variables are available in this template:
 * - $this: the CrudCode object
 */
?>
<?php echo "<?php\n"; ?>
/* @var $this <?php echo $this->getControllerClass(); ?> */
/* @var $model <?php echo $this->getModelClass(); ?> */
/* @var $form CActiveForm */
?>

<div class="form">
	<?php echo "<?php if(count(\$model->getErrors()) > 0):?>";?>
		<div class="alert alert-danger">
			<?php echo "<?php echo BSHtml::errorSummary(\$model); ?>";?>
		</div>
	<?php echo "<?php endif;?>";?>

	<?php echo "<?php echo BSHtml::beginForm(); ?>\n"; ?>
	<fieldset>
		<legend><?php echo "<?php echo \$model->isNewRecord ? 'Создать' : 'Редактировать'; ?>"; ?></legend>
		<p class="note">Поля, помеченные <span class="required">*</span> обязательны для заполнения.</p>
<?php
foreach($this->tableSchema->columns as $column)
{
	if($column->autoIncrement)
		continue;
?>
		<div class="form-group">
			<?php echo "<?php echo BSHtml::activeLabelEx(\$model,'{$column->name}', array('class'=>'col-lg-2')); ?>\n"; ?>
			<div class="col-lg-10">
				<?php echo "<?php echo BSHtml::activeTextField(\$model,'{$column->name}'); ?>\n"; ?>
			</div>
		</div>

<?php
}
?>
		<div class="form-group">
			<div class="col-lg-10 col-lg-offset-2 align-right">
				<?php echo "<?php echo BSHtml::submitButton(\$model->isNewRecord ? 'Создать' : 'Сохранить'); ?>\n"; ?>
			</div>
		</div>
	</fieldset>
<?php echo "<?php echo BSHtml::endForm(); ?>\n"; ?>

</div><!-- form -->